import request from '@/http/request'

interface AccessLogQueryParams {
  ip?: string
  timeRange?: string[]
  pageNum: number
  pageSize: number
}

interface AccessLogResponse {
  list: Array<{
    id: number
    ip: string
    location: string
    userAgent: string
    path: string
    method: string
    createTime: string
  }>
  total: number
}

// 获取访问日志列表
export function getAccessLogs(params: AccessLogQueryParams) {
  return request<AccessLogResponse>({
    url: '/blog/api/access-logs',
    method: 'get',
    params,
    headers: {
      'Authorization': localStorage.getItem('token')
    }
  })
} 